package com.ktwlsoft.archivemanage.payload.annualReport;

import com.ktwlsoft.archivemanage.domain.dao.entity.Report;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class ReportResponse extends Report implements Comparable<Report> {
    @Override
    public int compareTo(Report o) {
        String reportIdStr1=this.getReportId();
        String reportIdStr2=o.getReportId();
        Integer reportId1=0;
        Integer reportId2=0;
        if(reportIdStr1.length() > 22){
            reportId1=Integer.valueOf(reportIdStr1.substring(22));
        }else{
            reportId1=Integer.valueOf(reportIdStr1);
        }
        if(reportIdStr2.length() > 22){
            reportId2=Integer.valueOf(reportIdStr2.substring(22));
        }else{
            reportId2=Integer.valueOf(reportIdStr2);
        }
        return reportId2.compareTo(reportId1);
    }
}
